﻿using IntelligentAgriculture.Contracts.Interface.SheepFileModelInterface;
using IntelligentAgriculture.WebAPI.Application.Command.SheepfilemodelCommand;
using MediatR;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.SheepfilemodelCommandHandler
{
    public class SheepfileModeDeletelCommandHandler :IRequestHandler<SheepfilemodelsDeleteCommand,Results<int>>
    {
        private readonly ISheepFileModelService _sheepFileModelService;
        public SheepfileModeDeletelCommandHandler(ISheepFileModelService sheepFileModelService)
        {
            _sheepFileModelService = sheepFileModelService;
        }
        public async Task<Results<int>> Handle(SheepfilemodelsDeleteCommand request, CancellationToken cancellationToken)
        {
            var list = await _sheepFileModelService.DeleteSheepFileModel(request.SheepFileId);
            return Results<int>.DataResult(list);
        }

    }
}
